package main

import (
	"config"
	"dao"
	"domain"
	"ginservice"
	"log"
	"timer"
)

var dba *dao.YcDB
var err error
var runningorder *domain.RunningOrder
func main() {
	dba, err = dao.NewYcDB()
	if err != nil {
		log.Println(err.Error())
		return
	}
	runningorder = domain.NewRunningOrder()
	go timer.QueryAvgTime(dba, runningorder)
	r := ginservice.NewGin(runningorder)
	r.Run((&config.Config{}).String("Port"))


}
